package library;

public enum ErrorCode {

    LIBRARIAN_NOT_FOUND(110, "Librarian not found."),
    READER_NOT_FOUND(120, "Reader not found."),
    DUPLICATE_USER_FOUND(130, "Duplicate user found."),

    BOOK_NOT_FOUND(210, "Book not found."),
    BOOK_ALREADY_RESERVED(220, "Book already reserved."),
    BOOK_NOT_RESERVED(230, "Book is not reserved."),
    BOOK_OVERDUE(240, "Book is overdue"),

    READER_HAVE_EXPIRE_BOOK(310, "User have expire book."),
    RENEW_FAIL_MAX_COUNT_EXCESS(320, "Maximum renew count excess"),

    UNEXPECTED_ERROR(420, "Unexpected error");

    private final int code;
    private final String description;

    private ErrorCode(int code, String description) {
        this.code = code;
        this.description = description;
    }

    public String getDescription() {
        return description;
    }

    public int getCode() {
        return code;
    }
}
